<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<jsp:useBean id="defectbean" type="dtt.DefectBean" scope="request" />
<jsp:useBean id="projectbean" type="dtt.ProjectBean" scope="request" />

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'Content_template.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		
	<link rel="stylesheet" type="text/css" href="styles.css">
	
   <script language="javascript">
   
	function cancelForm(){
	  window.displaydefectform.DTT_ACTION.value="DEFECT_LIST";
	}
   </script>
	</head>

	<body>
		<br>
		<form name ="displaydefectform" action="servlet/FrontController" method="post">
		<input type="hidden" name="DTT_ACTION" value="UPDATE_DEFECT"/> 
	
		<table  border="0" align="center" width="85%">
			<tr>
				<td>
					<b>Project Number</b>
				</td>
				<td>
					<b>Project Description</b>
				</td>
				<td>
					<b>Project Category </b>
				</td>
			</tr>
			<tr>
				<td>
					<input type="text" name="projectId" value="<%=defectbean.getProjectId()%>" >
				</td>
				<td>
					<input type="text" name="ProjectDesc" value="ProjectDesc" value="<%=defectbean.getProjectId()%>" >
				</td>
				<td>
					<input type="text" name="projectCategory" value="<%=projectbean.getProjectCategory()%>" >
				</td>
			</tr>

			<tr>
				<td></td>
				<td></td>
				<td></td>
			</tr>

			<tr>
				<td>
					<b>Requirement ID</b>
				</td>
				<td>
					<b>Script ID</b>
				</td>
				<td>
					<b>Defect ID</b>
				</td>
			</tr>
			<tr>
				<td>
					<input type="text" name="requirementId" value="<%=defectbean.getRequirementId()%>" >
				</td>
				<td>
					<input type="text" name="testScriptId" value="<%=defectbean.getTestScriptId()%>" >
				</td>
				<td>
					<input type="text" name="defectId" value="<%=defectbean.getDefectId()%>">
				</td>
			</tr>

			<tr>
				<td></td>
				<td></td>
				<td></td>
			</tr>

			<tr>
				<td>
					<b>Date Submitted</b>
				</td>
				<td>
					<b>Severity</b>
				</td>
				<td>
					<b>Priority</b>
				</td>
			</tr>
			<tr>
				<td>
					<input type="text" name="DateSubmitted" >
				</td>
				<td>
					<input type="text" name="Severity" value="<%=defectbean.getDefectSeverity()%>">
				</td>
				<td>
					<input type="text" name="Priority" value="<%=defectbean.getDefectPriority()%>">
				</td>
			</tr>

			<tr>
				<td></td>
				<td></td>
				<td></td>
			</tr>

			<tr>
				<td>
					<b>Last Updated</b>
				</td>
				<td>
					<b>Reported By</b>
				</td>
				<td>
					<b>Assigned To</b>
				</td>
			</tr>
			<tr>
				<td>
					<input type="text" name="LastUpdated" <%=defectbean.getDefectLastUpdatedBy() %>>
				</td>
				<td>
					<input type="text" name="ReportedBy" <%=defectbean.getDefectReportedBy() %> >
				</td>
				<td>
					<input type="text" name="AssignedTo" >
				</td>
			</tr>

			<tr>
				<td></td>
				<td></td>
				<td></td>
			</tr>

			<tr>
				<td>
					<b>Can Be Reproduced</b>
				</td>
				<td>
					<b>Status</b>
				</td>
				<td>
					<b>Product Version Number</b>
				</td>
			</tr>
			<tr>
				<td>
					<input type="text" name="CanReproduce" <%=defectbean.getDefectReproducibility() %> > 
				</td>
				<td>
				<select name="defectStatus">
				<option value="<%= defectbean.getDefectStatus()%>" ><%=defectbean.getDefectStatus()%></option>
				<%
							ArrayList statuslist = defectbean.getValidFutureStates();
							if (statuslist != null) {
								Iterator it = statuslist.iterator();
								while (it.hasNext()) {
									String status = (String) it.next();
						%>
						<option value="<%=status %>">
							<%=status %>
						</option>
				<%
							}//End While

							}//End if
				%>
				
				</select>
				</td>
				<td>
					<input type="text" name="PVN" >
				</td>
			</tr>

			<tr>
				<td></td>
				<td></td>
				<td></td>
			</tr>

			<tr>
				<td>
					<b>Build Number</b>
				</td>
				<td>
					<b>Target Version Number</b>
				</td>
				<td>
					<b>Fixed In Version Number</b>
				</td>
			</tr>
			<tr>
				<td>
					<input type="text" name="BuildNo" <%=defectbean.getDefectBuildNbr() %>>
				</td>
				<td>
					<input type="text" name="TVN"  <%=defectbean.getDefectTgtVerNbr() %>>
				</td>
				<td>
					<input type="text" name="FVN" <%=defectbean.getDefectFixedinVerNbr() %>>
				</td>
			</tr>


		</table>
		<table border="0" align="center" width="85%">
			<tr>
				<td>
					<b>Description </b>
				</td>
			</tr>
			<tr>
				<td>
					<textarea rows="1" cols="80" name="defectDesc"></textarea>
				</td>
			</tr>
		</table>

		<table valign="top" border="0" align="center" width="85%"
			cellspacing="2" cellpadding="2">
			<tr>
				<td>
					<b>Steps To Reproduce the Defect</b>
				</td>
				<td>
					<b> Development Repair Comments</b>
				</td>
			</tr>
			<tr>
				<td>
					<textarea rows="15" name="defectStepstoReproduce" cols="40" <%=defectbean.getDefectStepstoReproduce() %>></textarea>
				</td>
				<td>
					<textarea rows="15" cols="40" name="defectDevFixCom" <%=defectbean.getDefectDevFixCom() %>></textarea>
				</td>
			</tr>
		</table>

		<br>
		<center>
			<table cellspacing="2" cellpadding="2">
				<tr><td><a href="/uploadbean/SimpleUpload.jsp">upload attachment </a></td>
					<td>
						<input type="submit" name="submit" value="Update">
					</td>
					<td width="20%">
					</td>
					<td>
						<input type="Submit" name="cancel" value="Cancel" onclick="cancelForm()">
					</td>


				</tr>

			</table>
			</center>
			</form>
	</body>
</html>

